package com.dao.lx;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.entity.Role;

public interface RoleDAO extends JpaRepository<Role, Long>{
	@Query("from Role r where r.roleIfdelete = 1 and r.roleName like %?1%")
	public Page<Role> findByRoleName(String roleName, Pageable p);

	@Query("from Role r where r.roleIfdelete = 1 and r.roleId = ?1")
	public Role findById(Long roleId);
	
	@Query("from Role r where r.roleIfdelete = 1")
	public Page<Role> findRoles(Pageable p);
}